#include "Maths.h"

NS_B2D_BEGIN

const float Maths::PI = 4.0f * atanf(1.0f);
const float Maths::PI_HALF = 0.5f * Maths::PI;
const float Maths::PI_TWO = 2.0f * Maths::PI;
const float Maths::EPSILON = FLT_EPSILON;

/*
void solveCubicPolynomial(float a, float b, float c, float d, float* roots)
{
    float q = ((3.f * c) - (b * b)) / 9.f;
	float q3 = q * q * q;
    float r = (-27.f * d) + b * ((9.f * c) - (2.f * b * b));
	float discriminant = q3 + (b * b);
	float rtDisc = sqrt(discriminant);
    float s = r + rtDisc;
	float t = r - rtDisc;
    float term1 = sqrt(3.f * ((-t + s) / 2.f));
    float r13 = 2.f * sqrt(q);

	roots[0] = (-term1 + r13 * cos(q3 / 3.f);
	roots[1] = (-term1 + r13 * cos(q3 + (2.f * PI) / 3.f);
	roots[2] = (-term1 + r13 * cos(q3 + (4.f * PI) / 3.f);
}*/

NS_B2D_END